package part4createthread;

/**
 * @description: 实现runnable接口，重写run方法，执行线程需要丢入runnable接口实现类，调用start方法
 * @date: 2022/10/6 11:12.
 * @version: 1.0
 */
public class CreateThreadDemo02 implements Runnable {


    @Override
    public void run() {
        for (int i = 0; i < 200; i++) {
            System.out.println("子线程正在执行--" + i);
        }
    }

    public static void main(String[] args) {
        CreateThreadDemo02 createThreadDemo02 = new CreateThreadDemo02();
        new Thread(createThreadDemo02).start();

        for (int i = 0; i < 200; i++) {
            System.out.println("主线程正在执行--" + i);
        }
    }

}
